{% extends 'system_template/public/base_main.html' %}
{% block cite %}
    删除内容 [ 回收站 ]
{% endblock %}
{% block content %}
    <div class="layui-card-header">
        <button class="layui-btn layui-btn-danger" onclick="checkbox(this,'DELETES')">
            <i class="layui-icon"></i>批量删除
        </button>
        <a class="layui-btn layui-btn-normal" href="javascript:;" onclick="checkbox(this,'RECOVERS')">
            <i class="layui-icon">&#x1005;</i> 批量恢复
        </a>
    </div>
    <table class="layui-table layui-form">
        <thead>
        <tr>
            <th>
                <input type="checkbox" lay-skin="primary" lay-filter="c_all">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i
                        class="layui-icon layui-icon-ok"></i></div>
            </th>
            <th>文档标题</th>
            <th>焦/轮/首/列/推/审核</th>
            <th>所属栏目</th>
            <th>阅读权限</th>
            <th>发布时间</th>
            <th>发布者</th>
            <th>点击数</th>
            <th>文档状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for data in data_list %}
         <tr>
            <td>
                <input type="checkbox" lay-skin="primary" value="{{ data.id }}">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
                    <i class="layui-icon layui-icon-ok"></i>
                </div>
            </td>
            <td style="color: {{ data.title_color }}">{{ data.title[:18] }}{% if data.title|length>18 %}...{% endif %}</td>
         <td>
                {{ data.is_focus|property|safe }}/
                {{ data.is_roll|property|safe }}/
                {{ data.is_index_stick|property|safe }}/
                {{ data.is_list_stick|property|safe }}/
                {{ data.is_recommend|property|safe }}/
                {{ data.status|property|safe }}
            </td>
            <td>{{ data.pro.column_name }}</td>
             <td>{{ data.permissions|is_pay }}</td>
            <td>{{ data.update_time }}</td>
             <td>{{ data.author }}</td>
             <td>{{ data.clicks }}</td>
            <td>{{ data.status|status }}</td>
            <td class="td-manage">
                <a class="but_sm" title="恢复" onclick="recover(this,{{ data.id }})"  href="javascript:;">恢复</a>
                <a class="but_sm del_but" title="删除" onclick="del(this,'{{ data.id }}')" href="javascript:;">
                    删除</a>
            </td>
        </tr>
        {% endfor %}
        </tbody>
    </table>

    {% if page.pages>1 %}
    <div class="layui-card-body ">
        <div class="page">
            <div>
            <a {% if page.has_prev %}class="next" href="?page={{ page.prev_num }}" {% else %}class="layui-btn-disabled"{% endif %}>上一页</a>
                {% for pg in page.iter_pages(2,2,2,2) %}
                    {% if page.page==pg %}
                        <span class="current">{{ pg }}</span>
                    {% else %}
                        {% if pg %}
                        <a class="num" href="?page={{ pg }}">{{ pg }}</a>
                        {% endif %}
                    {% endif %}
                {% endfor %}
            {% if not page.pages==page.page %}
            <a class="num" href="?page={{ page.pages }}">最后一页</a>
                {% endif %}
                <a {% if page.has_next %}class="next" href="?page={{ page.next_num }}" {% else %}class="layui-btn-disabled"{% endif %}>下一页</a>
            </div>
        </div>
    </div>
    {% endif %}
{% endblock %}
